package com.ban.controller;

import com.ban.entity.commonresult;
import com.ban.entity.footer;
import com.ban.entity.product;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.springframework.core.io.ClassPathResource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

import static javafx.scene.input.KeyCode.O;

@Controller
public class todaycontroller {
    @GetMapping("/buytoday")
    public String gettest(Map<String,Object> map) throws IOException {

        ClassPathResource classPathResource = new ClassPathResource("public/json/buytoday.json");
        File file = classPathResource.getFile();
        ObjectMapper mapper=new ObjectMapper();
        commonresult c = mapper.readValue(file, commonresult.class);

           map.put("comm",c);
           return "html/buytoday";
    }
}
